from die import Die
import pygal

D6 = Die()

results = []
for roll_num in range(1000):
    results.append(D6.roll())

print(results)
#分析结果
frequencies = []
for value in range(1, D6.num_sides + 1):
    frequencies.append(results.count(value))

print(frequencies)

hist = pygal.Bar()

hist.title = "Result of rolling one D6 1000 times."
hist.x_labels = [str(c for c in range(1, 7))]
hist._x_title = 'Result'
hist._y_title = 'Frequency of Result'

hist.add('D6', frequencies)
hist.render_to_file('die_visual.svg')
